package jgl.vajra.kingkong.part.vehicle.viewModel;

import java.util.List;
import java.util.Map;

import jgl.vajra.kingkong.bean.NearbyPointsBean;
import jgl.vajra.kingkong.part.vehicle.contract.WorkingFieldContract;
import jgl.vajra.kingkong.part.vehicle.model.WorkingFieldModel;
import jgl.vajra.kingkong.widget.mvvm.factory.CreateModel;
import jgl.vajra.kingkong.widget.retrofithelper.rxsubscriber.ProgressObserver;

@CreateModel(WorkingFieldModel.class)
public class WorkingFieldViewModel extends WorkingFieldContract.ViewModel{
    @Override
    public void getNearbyPoints(Map<String, Object> map) {
        mModel.getNearbyPoints(map).subscribe(new ProgressObserver<List<NearbyPointsBean>>(false,this) {
            @Override
            public void _onNext(List<NearbyPointsBean> data) {
                mView.returnNearbyPointsData(data);
            }

            @Override
            public void _onError(String errorMessage, int errorCode) {
                super._onError(errorMessage, errorCode);
            }
        });
    }
}
